1.
, which is 0.2855.
2.
, which is 1.75.
3. The
, which is 1.24 to 3.80.
Using this formula, the risk ratio would be expressed as 2.17, 95 percent CI 1.24 to 3.80.
You could also use R to calculate a risk ratio and 95 percent CI for the fourfold table in Figure
13-2 with the following steps:
1. Create a matrix.
Create a matrix called obese_HTN with this code: obese_HTN <- matrix(c(14,12,7,27),nrow = 2,
ncol = 2).
2. Load a library.
For many epidemiologic calculations, you can use the epitools package in R and use a command
from this package to calculate the risk ratio and 95 percent CI. Load the epitools library with this
command: library(epitools).
3. Run the command on the matrix.
In this case, run the riskratio.wald command on the obese_HTN matrix you created in Step 1:
riskratio.wald(obese_HTN).
The output is shown in Listing 13-1.
LISTING 13-1 R output from risk ratio calculation on data from Figure
13-2
> riskratio.wald(obese_HTN)
$data
Outcome
Predictor Disease1 Disease2 Total
Exposed1 14 7 21
Exposed2 12 27 39
Total 26 34 60
$measure
risk ratio with 95% C.I.
Predictor estimate lower upper
Exposed1 1.000000 NA NA
Exposed2 2.076923 1.09512 3.938939
$p.value
two-sided
Predictor midp.exact fisher.exact chi.square
Exposed1 NA NA NA
Exposed2 0.009518722 0.01318013 0.00744125
$correction
[1] FALSE
attr(,”method”)
[1] "Unconditional MLE & normal approximation (Wald) CI"
>